<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Open Stack</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css"/>//注意路劲
    <script src="/static/js/jquery.js"></script>
    <script src="/static/layui/layui.js"></script>

    <style>
        ol li a {
            background-color: rgba(0,0,0,1) !important;
        }

        .three_this {
            background-color: #808080 !important;
        }
    </style>
</head>
<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">Open Stack</div>
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item">
                    <a href="javascript:;">default & admin</a>
                    <dl class="layui-nav-child">
                        <dd><a href="">域名</a></dd>
                        <dd><a href="">用户名</a></dd>
                    </dl>
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="/static/images/admin.png" class="layui-nav-img" />
                        {{ request.session.userName }}
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="">设置</a></dd>
                        <dd><a href="">帮助</a></dd>
                        <dd><a href="/wyh0282/loginout">注销</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="javascript:;">项目</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="javascript:;" class="menu_three ">计算</a>
                                <ol class="layui-nav-child" style="display: none;">
                                    <li><a href="javascript:;">概述</a></li>
                                    <li><a href="/wyh0282/mServerLists" target="content_iFrm">实例</a></li>
                                    <li><a href="/wyh0282/mImagesLists" target="content_iFrm">卷</a></li>
                                    <li><a href="/wyh0282/mImagesLists" target="content_iFrm">映像</a></li>
                                    <li><a href="">访问&安全</a></li>
                                </ol>
                            </dd>
                            <dd><a href="javascript:;" class="menu_three">网络</a>
                                <ol class="layui-nav-child" style="display: none;">
                                    <li><a href="javascript:;">网络拓扑</a></li>
                                    <li><a href="javascript:;">网络</a></li>
                                </ol>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item " id="manage">
                        <a class="" href="javascript:;">管理员</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="javascript:;" class="menu_three ">系统</a>
                                <ol class="layui-nav-child" style="display: none;">
                                    <li><a href="javascript:;">概述</a></li>
                                    <li><a href="javascript:;">管理程序</a></li>
                                    <li><a href="javascript:;">主机聚集</a></li>
                                    <li><a href="/wyh0282/mServerLists" target="content_iFrm">实例</a></li>
                                    <li><a href="">卷</a></li>
                                    <li><a href="/wyh0282/mFlavorLists" target="content_iFrm">flavor</a></li>
                                    <li><a href="/wyh0282/mImagesLists" target="content_iFrm">映像</a></li>
                                    <li><a href="">网络</a></li>
                                    <li><a href="">缺省值</a></li>
                                    <li><a href="">元数据定义</a></li>
                                    <li><a href="/wyh0282/test" target="content_iFrm">系统信息</a></li>
                                </ol>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">身份管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="/wyh0282/mProjectLists" target="content_iFrm">项目</a></dd>
                            <dd><a href="/wyh0282/mUserLists" target="content_iFrm">用户</a></dd>
                            <dd><a href="/wyh0282/mGroupLists" target="content_iFrm">组</a></dd>
                            <dd><a href="/wyh0282/mRoleLists" target="content_iFrm">角色</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>


        <div class="layui-body">
            <!-- 内容主体区域 -->
        <iframe name="content_iFrm" frameborder="0" class="larry-iframe" style="width: 100%; height: 100%;"
                src="/wyh0282/mProjectLists"
        ></iframe>
        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->
            王一辉制作，抄袭必究
        </div>
    </div>
<script>
    {% comment %}$(function(){
        var role = {{request.session.userName}}
        alert(role)
        if(role != "admin"){
            document.getElementById("manage").hidden
        }
        document.getElementById("manage").style.visibility="hidden";
    });{% endcomment %}
        //JavaScript代码区域
        layui.use(['element', 'jquery'], function () {
            var element = layui.element, $ = layui.jquery;
            $(".menu_three").on("click", function () {
                $(this).next().toggle();
                $.each($(this).parent().siblings(), function (i, e) {
                    $(e).find("ol").hide();;
                });

            })
            $("ol").on("click", "li a", function () {
                $.each($(this).parent().siblings(), function (i, e) {
                    $(e).find("a").removeClass('three_this')
                });
                $(this).addClass('three_this');                            // 添加当前元素的样式
            })
        });
</script>
</body>
</html>